<!DOCTYPE>
{% extends "base.html" %}

{% block title %} {{ post.name }} {% endblock %}

{% block user %} {{ current_user.username }} {% endblock %}

<!-- Replace the Body of template base.html -->
{% block body %}
<h3> {{ post.title }} <a href=""> at {{ post.publish_date }} </a></h3> 

<div class="row">

	<div class="col-lg-6">
		<p> {{ post.text | safe }} </p>
	</div>
	
	<div class="column">
		<div class="col-lg-2">
			<a href="{{ url_for('blog.new_post') }}" class="btn btn-primary"> New </a>
		</div>
	</div>
	
	<div class="column">
		<div class="col-lg-2">
			<a href="{{ url_for('blog.edit_post', id=post.id) }}" class="btn btn-primary" > Edit </a>
		</div>
	</div>
	
</div>

<div class="col-lg-" >
	<h3>Comment the post:</h3>
	<!-- SET THE FORM -->
	<form method="POST" action="{{ url_for('blog.post', post_id=post.id) }}"> {{ form.hidden_tag() }}
	
	<div>
		<!-- FIELD: `name` label -->
		{{ form.name.label }}
		
		{% if form.name.errors %}
			{% for e in form.name.errors %}
				<p class="help-block" > {{ e }} </p>
			{% endfor %}			
		{% endif %}
		
		{{ form.name(class_="form-control") }}		
	</div>
	
	<div class="form-group" >
		{{ form.text.label }}
		
		{% if form.text.errors %}		
			{% for e in form.text.errors %}
				<p class="help-block" > {{ e }} </p>	
			{% endfor %}			
		{% endif %}
		
		{{ form.text(class_='form-control') }}	
	</div>

	<input class="btn btn-primary" type="submit" value="Add Comment" >
	</form>

</div>

{% endblock %}